import { Injectable } from "@angular/core";
import { BaseHttpService } from "../../../shared/services/baseHttp.service";
import { Observable } from "rxjs";
import { HttpClient } from "@angular/common/http";
import { IpListModel } from "./models/ipList.model";

@Injectable()
export class IpLoginService extends BaseHttpService {
    constructor(private http: HttpClient) {
        super()
    }

    public getIpList(accountId: string): Observable<IpListModel> {
        return this.http.get<IpListModel>(this.serverUrl + '/accountsserv/api/v1/accounts/ipauthentication/' + accountId);
    }

    public setIpList(data: IpListModel): Observable<boolean> {
        return this.http.post<boolean>(this.serverUrl + '/accountsserv/api/v1/accounts/ipauthentication', data);
    }
}